package com.anyisn.anyflickr.modules.PhotoInfo.controller
{
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	
	import com.anyisn.anyflickr.modules.PhotoInfo.PhotoInfoModule;
	import com.anyisn.anyflickr.modules.PhotoInfo.view.ModuleJunctionMediator;
	import com.anyisn.anyflickr.modules.PhotoInfo.view.PhotoInfoWindowMediator;
	import com.anyisn.anyflickr.modules.PhotoInfo.view.component.PhotoInfoWindow;
	
	public class ViewPrepCommand extends SimpleCommand
	{
		override public function execute(notification:INotification) : void {
			facade.registerMediator(new ModuleJunctionMediator());
			var module:PhotoInfoModule = notification.getBody() as PhotoInfoModule;
			var photoInfoWin:PhotoInfoWindow = new PhotoInfoWindow(module.bitmap, module.photo);
			photoInfoWin.moduleID = module.getID();
			facade.registerMediator(new PhotoInfoWindowMediator(photoInfoWin));
		}
	}
}